{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "vscode": {
     "languageId": "shellscript"
    }
   },
   "outputs": [],
   "source": [
    "pip install pymysql"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pymysql\n",
    "\n",
    "connection = pymysql.connect(\n",
    "    host='127.0.0.1',\n",
    "    port=3306,\n",
    "    user='root',\n",
    "    password='yourpassword'\n",
    ")\n",
    "\n",
    "try:\n",
    "    with connection.cursor() as cursor:\n",
    "        cursor.execute(\"SELECT VERSION()\")\n",
    "        result = cursor.fetchone()\n",
    "        print(\"MySQL version:\", result[0])\n",
    "finally:\n",
    "    connection.close()\n"
   ]
  }
 ],
 "metadata": {
  "language_info": {
   "name": "python"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
